/*
 * Copyright 2006 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package com.googlecode.continuity.plugin.gwtext.client;

/**
 * Characteristic interface which indicates that a widget has an associated
 * position.
 */
public interface HasPosition {

  /**
   * Position constant.
   */
  public static final class PositionConstant {
    private String positionId;

    private PositionConstant(String positionId) {
      this.positionId = positionId;
    }

    /**
     * Gets position id associated with this constant.
     *
     * @return the position value
     */
    public String getPositionId() {
      return positionId;
    }
  }

  /**
   * Specifies that the widget's position is to the top.
   */
  public static final PositionConstant POSITION_TOP = new PositionConstant("top");

  /**
   * Specifies that the widget's position is to the right.
   */
  public static final PositionConstant POSITION_RIGHT = new PositionConstant("right");

  /**
   * Specifies that the widget's position is to the bottom.
   */
  public static final PositionConstant POSITION_BOTTOM = new PositionConstant("bottom");

  /**
   * Specifies that the widget's position is to the the left.
   */
  public static final PositionConstant POSITION_LEFT = new PositionConstant("left");

  /**
   * Gets the position.
   *
   * @return the current position.
   */
  public PositionConstant getPosition();

  /**
   * Sets the position.
   *
   * @param position the position (
   *                 {@link HasPosition#POSITION_TOP},
   *                 {@link HasPosition# POSITION_RIGHT},
   *                 {@link HasPosition# POSITION_BOTTOM}, or
   *                 {@link HasPosition# POSITION_LEFT}).
   */
  public void setPosition(PositionConstant position);
}
